package revenge.jack_cristo.shiyuanbaoyou;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class WebviewActivity extends AppCompatActivity {
    private WebView webView;
    private String url;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.publicvebview);
        webView = (WebView) findViewById(R.id.publicWebview);
        Intent intent = getIntent();
        String url = intent.getExtras().getString("weburl");

        webView.loadUrl(url);
        //开启JavaScript支持
        webView.getSettings().setJavaScriptEnabled(true);
        //强制使用web view加载网页
        webView.setWebViewClient(new WebViewClient() {
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
            }
        });

    }
}
